/*
* Copyright (C) 2012-2014 qar
* License: http://www.gnu.org/licenses/gpl.html GPL version 2
*/

#ifndef SIGNER_H
#define SIGNER_H

#include <QtCore>

class Signer
{
public:
    Signer();
    virtual ~Signer();

    virtual qint64 hashSize() const = 0;
    virtual QString getAlgorithmName() const = 0;

    virtual void signSegment(const QByteArray &segment, QByteArray &signedSegment) = 0;
    virtual bool checkAndExtractSegment(const QByteArray &signedSegment, QByteArray &segment) = 0;

    // Serialization of parameters
    virtual bool toStream(QDataStream &s) = 0;
    virtual bool fromStream(QDataStream &s) = 0;

private:
    Q_DISABLE_COPY(Signer)
};

#endif // SIGNER_H
